<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function fun1() {
            alert('内容已更改');
        }
    </script>
</head>

<body>
    <!-- onchange:当输入框里面的文本发生变化之后会触发的 -->
    <input type="text" onchange="fun1()">
</body>

</html>